﻿<navigation:Page xmlns:my="clr-namespace:AppLab.LoginUI"  x:Class="AppLab.Views.History"
           xmlns:local="clr-namespace:AppLab"
           xmlns:control="clr-namespace:AppLab.Controls"
           xmlns:web="clr-namespace:AppLab.Web"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="800" d:DesignHeight="800"
           d:DataContext="{d:DesignInstance Type=web:HistoryData}"  
           Style="{StaticResource PageStyle}" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">

    <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">

        <Grid x:Name="LayoutRoot">
            <Grid.Resources>
                <local:DateTimeConverter x:Key="DateConverter" />
                <local:NullItemToEntity x:Key="NullItemToEntity"/>
                <local:BooleanToVisibilityConverter x:Key="VisibleConverter"/>
            </Grid.Resources>
            <toolkit:BusyIndicator x:Name="busyIndicatorLoad" Grid.RowSpan="2"  BusyContent="{Binding Path=ApplicationStrings.BusyIndicatorLoad, Source={StaticResource ResourceWrapper}}">
                <toolkit:BusyIndicator x:Name="busyIndicator" BusyContent="{Binding Path=ApplicationStrings.BusyIndicatorRegisteringUser, Source={StaticResource ResourceWrapper}}"
                             IsBusy="{Binding IsBusy}">
                    <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}">
                        <!--用户认为显示在桌面多余
                    <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" 
                           Text="{Binding Path=ApplicationStrings.HistoryPageTitle, Source={StaticResource ResourceWrapper}}"/>
                    <TextBlock x:Name="ContentText" Style="{StaticResource ContentTextStyle}" 
                           Text="客户端版本查看"/>-->
                        <Grid Height="50" >

                            <Image Height="35" Stretch="UniformToFill" Source="/AppLab;component/Images/dx.png" HorizontalAlignment="Left"/>

                            <TextBlock Text="{Binding Path=ApplicationStrings.SelectedMobileBrandOnTerminalInfo, Source={StaticResource ResourceWrapper}}" 
                                   VerticalAlignment="Center"  Margin="220,0,0,0" HorizontalAlignment="Left" FontSize="13" Foreground="Black"
                                   Style="{StaticResource ContentTextStyle}"/>
                            <ComboBox Name="mobileBrand" Height="23" Margin="285,0,0,0" HorizontalAlignment="Left" Width="100" SelectionChanged="mobileBrand_SelectionChanged"/>
                            <TextBlock Text="{Binding Path=ApplicationStrings.InputMobileTypeOnTerminalInfo, Source={StaticResource ResourceWrapper}}" 
                                   VerticalAlignment="Center"  Margin="420,0,0,0" HorizontalAlignment="Left" FontSize="13" Foreground="Black"
                                   Style="{StaticResource ContentTextStyle}"/>
                            <sdk:AutoCompleteBox Name="autoCompleteBoxMbBrand" Height="23" IsTextCompletionEnabled="True" HorizontalAlignment="Left" 
                                             Width="120" Margin="490,0,0,0" VerticalAlignment="Center" IsDropDownOpen="True"
                                             TabNavigation="Cycle" GotFocus="autoCompleteBoxMbBrand_GotFocus" />
                            <Button Name="SearchButton" Content="{Binding Path=ApplicationStrings.SearchButtonOnTerminalInfo, Source={StaticResource ResourceWrapper}}"
                                HorizontalAlignment="Left" Margin="610,0,0,0" 
                                Height="23" Click="SearchButton_Click" />

                            <Button Name="ShowAllMobileInfo" Content="全部终端" Style="{StaticResource LoginRegisterLinkStyle}" 
                                             HorizontalAlignment="Left" Margin="645,10,0,0" Foreground="Blue" Click="ShowAllMobileInfo_Click" />
                        </Grid>
                        <Grid Name="gridPhoneInfo">
                            <sdk:DataGrid Name="dgPhoneInfo"  Height="200"  AutoGenerateColumns="False" 
                                  IsReadOnly="True" GridLinesVisibility="Vertical" HorizontalAlignment="Left" 
                                  BorderThickness="2" BorderBrush="#FFCE6A6A" ColumnWidth="100" Margin="20,0,0,0"
                                  VerticalAlignment="Top" SelectionChanged="dgPhoneInfo_SelectionChanged" SelectionMode="Single">
                                <sdk:DataGrid.Columns>
                                    <sdk:DataGridTextColumn Header="品牌" Binding="{Binding MobileBrand}" />
                                    <sdk:DataGridTextColumn Header="型号" Binding="{Binding MobileType}" />
                                    <sdk:DataGridTextColumn Header="系统" Binding="{Binding MobileOS}" />
                                    <sdk:DataGridTextColumn Header="分辨率" Binding="{Binding Resoulution}" />
                                    <sdk:DataGridTextColumn Header="屏幕尺寸" Binding="{Binding ScreenSize}" />
                                    <sdk:DataGridTextColumn Header="是否支持3G" Binding="{Binding IsOn3G}"/>
                                    <sdk:DataGridTextColumn Header="是否支持流媒体" Width="110" Binding="{Binding IsOnStreamMedia}" />
                                    <sdk:DataGridTextColumn Header="是否支持触摸" Binding="{Binding IsOnTouch}" />
                                    <sdk:DataGridTextColumn Header="上市时间" Binding="{Binding InformationTime,StringFormat=yyy-MM-dd}" />
                                </sdk:DataGrid.Columns>
                            </sdk:DataGrid>
                        </Grid>
                        <Grid>
                            <sdk:DataPager Name="dpPhoneInfo" VerticalAlignment="Top" IsTotalItemCountFixed="True" HorizontalAlignment="Left"  Source="{Binding ItemsSource, ElementName=dgPhoneInfo}" Margin="20,0,0,0" Grid.Row="1">
                            </sdk:DataPager>
                        </Grid>

                        <TextBlock Name="TipsForMobileVersion" Height="30" VerticalAlignment="Bottom"  Margin="20,10,0,0" FontSize="14" Foreground="Blue"></TextBlock>

                        <Grid Name="VersionsOfMobileGrid" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="{Binding ElementName=VersionsOfMobileGrid,Path=IsHitTestVisible,Converter={StaticResource VisibleConverter}}" Margin="20,0,0,0">
                            <sdk:DataGrid Name="dgPhoneAllVersionInfo"  Height="200"  AutoGenerateColumns="False" 
                                  IsReadOnly="True" GridLinesVisibility="Vertical" HorizontalAlignment="Left" 
                                  BorderThickness="2" BorderBrush="#FFCE6A6A" ColumnWidth="80" VerticalAlignment="Top" 
                                          SelectionChanged="dgPhoneAllVersionInfo_SelectionChanged" SelectionMode="Single" >
                                <sdk:DataGrid.Columns>
                                    <sdk:DataGridTextColumn Header="版本" Binding="{Binding MobileVersion}" />
                                    <sdk:DataGridTextColumn Header="提交人" Binding="{Binding SubmitBy}" />
                                    <sdk:DataGridTextColumn Header="提交时间" Width="120" Binding="{Binding SubmitTime, StringFormat=yyyy-MM-dd HH:mm}" />
                                    <sdk:DataGridTextColumn Header="审核人" Binding="{Binding ReviewBy}" />
                                    <sdk:DataGridTextColumn Header="审核时间" Width="120" Binding="{Binding ReviewEndTime, StringFormat=yyyy-MM-dd HH:mm}" />
                                    <sdk:DataGridTextColumn Header="优先级" Width="60" Binding="{Binding Priority}"/>
                                    <sdk:DataGridTextColumn Header="验收人" Binding="{Binding AssignedTo}" />
                                    <sdk:DataGridTextColumn Header="指定验收完成时间" Width="120" Binding="{Binding TestTaskEAT, StringFormat=yyyy-MM-dd}"/>
                                    <sdk:DataGridTextColumn Header="实际验收完成时间" Width="120" Binding="{Binding TestEndTime, StringFormat=yyyy-MM-dd HH:mm}"/>
                                    <sdk:DataGridTextColumn Header="状态" Width="120" Binding="{Binding StateStr}" />
                                </sdk:DataGrid.Columns>
                            </sdk:DataGrid>

                            <sdk:DataPager Name="dpVersionInfo" Margin="0,200,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" IsTotalItemCountFixed="True" Source="{Binding ItemsSource, ElementName=dgPhoneAllVersionInfo}">
                            </sdk:DataPager>

                        </Grid>

                        <Grid Name="VersionInfoGrid" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="{Binding ElementName=VersionInfoGrid,Path=IsHitTestVisible,Converter={StaticResource VisibleConverter}}" Margin="20,0,0,0">

                            <TextBlock Name="TipsForVersionInfo" Height="30" VerticalAlignment="Top" Margin="0,10,0,0" FontSize="14" Foreground="Blue"></TextBlock>

                            <control:ReviewCustomDataForm x:Name="hisForm" 
                          CurrentItem="{Binding ElementName=dgPhoneAllVersionInfo, Path=SelectedItem,Converter={StaticResource NullItemToEntity}}"
                          AutoEdit="True" CommandButtonsVisibility="None" 
                          Style="{StaticResource DataFormStyle}"
                          HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,40,0,0" />

                            <Grid Margin="390,10,0,0">
                                <TextBlock Name="TipsForPublishedStr" Height="30" VerticalAlignment="Top" Margin="0,10,0,0" FontSize="14" Foreground="Blue"></TextBlock>
                                <TextBlock Name="PublishedStr" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="60,40,0,0" FontSize="13" Width="300"/>
                            </Grid>

                            <Grid Margin="390,80,0,0" Name="TipsForReject" Visibility="{Binding ElementName=TipsForReject,Path=IsHitTestVisible,Converter={StaticResource VisibleConverter}}">
                                <TextBlock Name="TipsForRejectCom" Height="30" VerticalAlignment="Top" Margin="0,10,0,0" FontSize="14" Foreground="Red"></TextBlock>
                                <TextBlock Name="TipsForRejectComment" VerticalAlignment="Top" Margin="60,40,0,0" TextWrapping="Wrap" Width="300"/>
                            </Grid>
                        </Grid>
                    </StackPanel>
                </toolkit:BusyIndicator>
            </toolkit:BusyIndicator>
        </Grid>
    </ScrollViewer>
</navigation:Page>

